package model

import (
	"gorm.io/gorm"
	"time"
)

type Comments struct {
	Id        uint           `gorm:"column:id;type:bigint UNSIGNED;comment:id;primaryKey;not null;" json:"id"`                // id
	UserId    uint           `gorm:"column:user_id;type:bigint UNSIGNED;comment:用户id;not null;default:0;" json:"user_id"`     // 用户id
	VideoId   uint           `gorm:"column:video_id;type:bigint UNSIGNED;comment:视频id;not null;default:0;" json:"video_id"`   // 视频id
	Content   string         `gorm:"column:content;type:varchar(300);comment:评论内容;not null;" json:"content"`                  // 评论内容
	FatherId  uint           `gorm:"column:father_id;type:bigint UNSIGNED;comment:父级id;not null;default:0;" json:"father_id"` // 父级id
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (co *Comments) TableName() string {
	return "comments"
}
